<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>SB Admin - Blank Page</title>

    <!-- Custom fonts for this template-->
    <link href="/public/Admin/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">

    <!-- Page level plugin CSS-->
    <link href="/public/Admin/vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet">

    <!-- Custom styles for this template-->
    <link href="/public/Admin/css/sb-admin.css" rel="stylesheet">

</head>

<body id="page-top">

    <nav class="navbar navbar-expand navbar-dark bg-dark static-top">

        <a class="navbar-brand mr-1" href="index.html">Start Bootstrap</a>

        <button class="btn btn-link btn-sm text-white order-1 order-sm-0" id="sidebarToggle" href="#">
            <i class="fas fa-bars"></i>
        </button>

        <!-- Navbar Search -->
        <form class="d-none d-md-inline-block form-inline ml-auto mr-0 mr-md-3 my-2 my-md-0">
            <div class="input-group">
                <input type="text" class="form-control" placeholder="Search for..." aria-label="Search"
                    aria-describedby="basic-addon2">
                <div class="input-group-append">
                    <button class="btn btn-primary" type="button">
                        <i class="fas fa-search"></i>
                    </button>
                </div>
            </div>
        </form>

        <!-- Navbar -->
        <ul class="navbar-nav ml-auto ml-md-0">
            <li class="nav-item dropdown no-arrow mx-1">
                <a class="nav-link dropdown-toggle" href="#" id="alertsDropdown" role="button" data-toggle="dropdown"
                    aria-haspopup="true" aria-expanded="false">
                    <i class="fas fa-bell fa-fw"></i>
                    <span class="badge badge-danger">9+</span>
                </a>
                <div class="dropdown-menu dropdown-menu-right" aria-labelledby="alertsDropdown">
                    <a class="dropdown-item" href="#">Action</a>
                    <a class="dropdown-item" href="#">Another action</a>
                    <div class="dropdown-divider"></div>
                    <a class="dropdown-item" href="#">Something else here</a>
                </div>
            </li>
            <li class="nav-item dropdown no-arrow mx-1">
                <a class="nav-link dropdown-toggle" href="#" id="messagesDropdown" role="button" data-toggle="dropdown"
                    aria-haspopup="true" aria-expanded="false">
                    <i class="fas fa-envelope fa-fw"></i>
                    <span class="badge badge-danger">7</span>
                </a>
                <div class="dropdown-menu dropdown-menu-right" aria-labelledby="messagesDropdown">
                    <a class="dropdown-item" href="#">Action</a>
                    <a class="dropdown-item" href="#">Another action</a>
                    <div class="dropdown-divider"></div>
                    <a class="dropdown-item" href="#">Something else here</a>
                </div>
            </li>
            <li class="nav-item dropdown no-arrow">
                <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown"
                    aria-haspopup="true" aria-expanded="false">
                    <i class="fas fa-user-circle fa-fw"></i>
                </a>
                <div class="dropdown-menu dropdown-menu-right" aria-labelledby="userDropdown">
                    <a class="dropdown-item" href="#">Settings</a>
                    <a class="dropdown-item" href="#">Activity Log</a>
                    <div class="dropdown-divider"></div>
                    <a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal">Logout</a>
                </div>
            </li>
        </ul>

    </nav>

    <div id="wrapper">

        <!-- Sidebar -->
        <ul class="sidebar navbar-nav">
            <li class="nav-item">
                <a class="nav-link" href="{:url('admin/home/index')}">
                    <i class="fas fa-fw fa-tachometer-alt"></i>
                    <span>仪表盘</span>
                </a>
            </li>
            <li class="nav-item dropdown show">
                <a class="nav-link dropdown-toggle" href="#" id="pagesDropdown" role="button" data-toggle="dropdown"
                    aria-haspopup="true" aria-expanded="true">
                    <i class="fas fa-fw fa-folder"></i>
                    <span>页面</span>
                </a>
                <div class="dropdown-menu show" aria-labelledby="pagesDropdown ">
                    <h6 class="dropdown-header">常用操作</h6>
                    <a class="dropdown-item" href="{:url('admin/classification/index')}">分类管理</a>
                    <a class="dropdown-item" href="{:url('admin/submitmanagement/index')}">投稿管理</a>
                    <a class="dropdown-item active" href="{:url('admin/troubleshooting/index')}">疑难解答</a>
                    <div class="dropdown-divider"></div>
                    <h6 class="dropdown-header">Other Pages:</h6>
                    <a class="dropdown-item" href="404.html">404 Page</a>
                    <a class="dropdown-item " href="blank.html">Blank Page</a>
                </div>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="charts.html">
                    <i class="fas fa-fw fa-chart-area"></i>
                    <span>Charts</span></a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="tables.html">
                    <i class="fas fa-fw fa-table"></i>
                    <span>Tables</span></a>
            </li>
        </ul>

        <div id="content-wrapper">

            <div class="container-fluid">

                <!-- Breadcrumbs-->
                <ol class="breadcrumb">
                    <li class="breadcrumb-item">
                        <a href="{:url('admin/home/index')}">仪表盘</a>
                    </li>
                    <li class="breadcrumb-item">
                        <a href="{:url('admin/troubleshooting/index')}">疑难解答</a>
                    </li>
                    <li class="breadcrumb-item active">
                        回收站
                    </li>
                </ol>

                <!-- Page Content -->
                <div>

                    <div class="card mb-3">
                        <div class="card-header">
                            <i class="fas fa-table"></i>
                            已删除的数据列表
                            <div onclick="window.location.href='{:url(\'admin/troubleshooting/index\')}';"
                                style=" color: rgb(0, 255, 0); height: 100%; float: right;">
                                <i style=" color: rgb(0, 255, 0);" class="fa fa-th-list" aria-hidden="true"></i>
                                返回疑难解答
                            </div>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive">
                                <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
                                    <thead>
                                        <tr align="center">
                                            <th>ID</th>
                                            <th>缩略图</th>
                                            <th>标题</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {volist name="list" id="vo"}
                                        <tr id='listID_{$vo.id}'>
                                            <td align="center">{$vo.id}</td>
                                            <td align="center" onclick="clickView('{$vo.the_thumbnail}')">点击查看</td>
                                            <td align="center">{$vo.title}</td>
                                            <td align="center">
                                                <a style="color:aqua" onclick="tools('rec','{$vo.id}')">恢复</a>
                                                |
                                                <a style="color:pink" onclick="tools('delete','{$vo.id}')">删除</a>
                                            </td>
                                        </tr>
                                        {/volist}
                                    </tbody>

                                </table>
                            </div>
                        </div>
                        <div class=" card-footer small text-muted">最后的更新时间{$DataTime}
                        </div>
                    </div>

                    <p class="small text-center text-muted my-5">
                        <em>More table examples coming soon...</em>
                    </p>

                </div>

            </div>

        </div>
        <!-- /.container-fluid -->

        <!-- Sticky Footer -->
        <footer class="sticky-footer">
            <div class="container my-auto">
                <div class="copyright text-center my-auto">
                    <span>Copyright © Your Website 2019</span>
                </div>
            </div>
        </footer>

    </div>
    <!-- /.content-wrapper -->

    </div>
    <!-- /#wrapper -->

    <!-- Scroll to Top Button-->
    <a class="scroll-to-top rounded" href="#page-top">
        <i class="fas fa-angle-up"></i>
    </a>

    <!-- Logout Modal-->
    <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
        aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
                    <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                </div>
                <div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
                <div class="modal-footer">
                    <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
                    <a class="btn btn-primary" href="login.html">Logout</a>
                </div>hu
            </div>
        </div>
    </div>

    <!-- Bootstrap core JavaScript-->
    <script src="/public/Admin/vendor/jquery/jquery.min.js"></script>
    <script src="/public/Admin/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

    <!-- Core plugin JavaScript-->
    <script src="/public/Admin/vendor/jquery-easing/jquery.easing.min.js"></script>

    <!-- Custom scripts for all pages-->
    <script src="/public/Admin/js/sb-admin.min.js"></script>
    <script>
        function tools(methods, data) {
            switch (methods) {
                case 'delete':
                    $.ajax({
                        type: "POST",
                        url: "{:url('admin/troubleshooting/deletelistentdelete')}",
                        data: {
                            data: data,
                        },
                        dataType: "JSON",
                        success: function (response) {
                            if (response.code) {
                                $('#listID_' + data).empty();
                                alert('删除成功')
                            } else {
                                alert('删除失败了')
                            }
                        }
                    });
                    break;
                case 'rec':
                    $.ajax({
                        type: "POST",
                        url: "{:url('admin/troubleshooting/deletelistrec')}",
                        data: {
                            data: data
                        },
                        dataType: "JSON",
                        success: function (response) {
                            if (response.code) {
                                $('#listID_' + data).empty();
                                alert('恢复成功');
                            } else {
                                alert('恢复失败了');
                            }
                        }
                    });
                    break;
                default:
                    console.log(undefined);
                    break;
            }
        }
    </script>
</body>

</html>